//
//  HTTPPromise+Login.m
//  HTHappySale
//
//  Created by 创维海通 on 2017/9/15.
//  Copyright © 2017年 zxyywy. All rights reserved.
//

#import "HTTPPromise+Login.h"

@implementation HTTPPromise (Login)

+ (HTTPPromise *)requestWeiXinCreateParams:(NSData *)params
                                   Success:(HTTPPromiseFulfiller)success
                                   failure:(HTTPPromiseRejecter)failure{
    return [self POST:LoginWeixin_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requesSendCodeParams:(NSData *)params
                                   Success:(HTTPPromiseFulfiller)success
                                   failure:(HTTPPromiseRejecter)failure{
    return [self POST:LoginSendVerificationCode_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requesBindMobileParams:(NSData *)params
                                Success:(HTTPPromiseFulfiller)success
                                failure:(HTTPPromiseRejecter)failure{
    return [self POST:LoginBindMobile_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requesSaveMyInfoParams:(NSData *)params
                                Success:(HTTPPromiseFulfiller)success
                                failure:(HTTPPromiseRejecter)failure{
    return [self POST:LoginSaveMyInfo_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requestUserInfoParams:(NSData *)params
                               Success:(HTTPPromiseFulfiller)success
                               failure:(HTTPPromiseRejecter)failure
{
    return [self POST:MainUser_Info_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requestUserRegionParams:(NSData *)params
                                 Success:(HTTPPromiseFulfiller)success
                                 failure:(HTTPPromiseRejecter)failure
{
    return [self POST:MainUserRegion_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

+ (HTTPPromise *)requestRegionAllParams:(NSData *)params
                                Success:(HTTPPromiseFulfiller)success
                                failure:(HTTPPromiseRejecter)failure
{
    return [self POST:MainRegionAll_URL
           parameters:nil
                 json:params
              success:success
              failure:failure];
}

@end
